home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2001 January / MacHome Magazine Demo Disc January 2001.iso / mac / Software / Networking / InterMapper 3.0 - PPC.sea / InterMapper 3.0 - PPC / InterMapper™ 3.0-PPC / InterMapper™ 3.0-PPC.rsrc / PrTy_165_com.dartware.tcp.rtsp < prev    next >
Encoding:
Text File  |  2000-07-24  |  3.9 KB  |  129 lines

  1. <!-- 
  2.     RTSP (com.dartware.tcp.rtsp)
  3.     Copyright © 2000 Dartware, LLC. All rights reserved.
  4. -->
  5.  
  6. <header>
  7.     type            =     "tcp-script"
  8.     package            =     "com.dartware"
  9.     probe_name        =    "tcp.rtsp"
  10.     human_name        =    "RTSP"
  11.     version            =     "1.1"
  12.     address_type    =     "IP"
  13.     port_number        =    "554"
  14.     
  15.     old_protocol    =     "8"            # Backward compat. with old numbering scheme.
  16.     old_script        =     "8115"
  17.  
  18. </header>
  19.  
  20. <description>
  21.  
  22. ≤GB≥RealTime Streaming Protocol (RTSP)≤P≥
  23.  
  24. The protocol used to control real-time streams, defined in ≤U2≥RFC 2326≤P0≥ and ≤U2≥RFC 1889≤P0≥.  The default TCP port number for RTSP connections is port 554.
  25.  
  26. This TCP probe lets you check that the server is up and responding.
  27.  
  28. </description>
  29.  
  30. <parameters>
  31.  
  32. "Movie Name"            =    "Beige.mov"
  33. "Seconds to play"        =    "5"
  34.  
  35. </parameters>
  36.  
  37. <script>
  38.  
  39. CONN #60 (connect timeout in seconds)
  40. WAIT #30 @IDLE (idle timeout in seconds)
  41. DISC @DISCONNECT (disconnect handler)
  42.  
  43. -- Send an OPTIONS command to the server. We do this to verify that we are
  44. -- in fact communicating with an RTSP server. The first line returned should
  45. -- match "RTSP/... 200"
  46.  
  47. SEND "OPTIONS rtsp://${_REMOTEADDRESS}/${Movie Name} RTSP/1.0\r\n"
  48. SEND "CSeq: 1\r\n\r\n"
  49. MTCH m"^RTSP/... +200"i else @BAD_OPTIONS_RESPONSE
  50. EXPT m"^$" (match blank line)
  51.  
  52. -- Send a DESCRIBE command to the server.
  53.  
  54. SEND "DESCRIBE rtsp://${_REMOTEADDRESS}/${Movie Name} RTSP/1.0\r\n"
  55. SEND "CSeq: 2\r\n\r\n"
  56. MTCH m"^RTSP/... +200"i else @BAD_DESCRIBE_RESPONSE
  57. EXPT m"^Content-length: *(#+)$"i
  58. EXPT m"^$" (match blank line)
  59.  
  60. LINE #${1}  --what if value > 2048?
  61. MTCH m"a=control:(trackID=#+)"i
  62. STOR "TRACK_ID" "${1}"
  63.  
  64. -- Send a SETUP command to the server.
  65.  
  66. RTPO "UDP_RTP" #7970
  67.  
  68. SEND "SETUP rtsp://${_REMOTEADDRESS}/${Movie Name}/${TRACK_ID} RTSP/1.0\r\n"
  69. SEND "Transport: RTP/AVP/UDP;unicast;client_port=${UDP_RTP};mode=play\r\n"
  70. SEND "CSeq: 3\r\n\r\n"
  71. MTCH "^RTSP/... +200"ri else goto @BAD_SETUP_RESPONSE
  72. EXPT "^Session: ([A-Z0-9]+)"ri else goto @NO_SESSION>  ($1 is the saved session id)
  73. EXPT "^$"r else goto @DISCONNECT (matches blank line)
  74. STOR "SESSION_ID" "${1}"
  75.  
  76. SEND "PLAY rtsp://${_REMOTEADDRESS}/${Movie Name}/${TRACK_ID} RTSP/1.0\r\n"
  77. SEND "CSeq: 4\r\n"
  78. SEND "Session: ${SESSION_ID}\r\n\r\n"
  79. MTCH "^RTSP/... +200"ri else goto @BAD_PLAY_RESPONSE
  80. EXPT "^$"r else goto @DISCONNECT (matches blank line)
  81.  
  82. WAIT #${Seconds to play} (set idle timeout to n seconds)
  83. EXPT "MATCH NOTHING" else #+1 (abuse EXPT cmd to wait for n seconds)
  84. WAIT #30 seconds else goto @IDLE if disconnected goto @DISCONNECT (restore previous timeouts)
  85.  
  86. SEND "PAUSE rtsp://${_REMOTEADDRESS}/${Movie Name}/${TRACK_ID} RTSP/1.0\r\n"
  87. SEND "CSeq: 5\r\n"
  88. SEND "Session: ${SESSION_ID}\r\n\r\n"
  89. MTCH "^RTSP/... +200"ri else goto @BAD_PAUSE_RESPONSE
  90. EXPT "^$"r else goto @DISCONNECT (matches blank line)
  91.  
  92. SEND "TEARDOWN rtsp://${_REMOTEADDRESS}/${Movie Name}/${TRACK_ID} RTSP/1.0\r\n"
  93. SEND "CSeq: 6\r\n"
  94. SEND "Session: ${SESSION_ID}\r\n\r\n"
  95. MTCH "^RTSP/... +200"ri else goto @BAD_TEARDOWN_RESPONSE
  96. EXPT "^$"r else goto @DISCONNECT (matches blank line)
  97.  
  98. DONE OKAY
  99.  
  100. @DISCONNECT:
  101. DONE DOWN "[RTSP] Disconnected from port ${_REMOTEPORT} after ${_SECSCONNECTED} seconds."
  102.  
  103. @IDLE:
  104. DONE DOWN "[RTSP] No data for ${_IDLETIMEOUT} seconds.  Was expecting \"${_STRINGTOMATCH}\". [Line ${_IDLELINE}]"
  105.  
  106. @BAD_OPTIONS_RESPONSE:
  107. DONE ALRM "[RTSP] Unexpected response to OPTIONS command. (${_LINE:50})"
  108.  
  109. @BAD_DESCRIBE_RESPONSE:
  110. MTCH m"^RTSP/... +404"i else @UNKNOWN_DESCRIBE_RESPONSE
  111. DONE WARN "[RTSP] Movie Name \"${Movie Name}\" not found. (${_LINE:50})"
  112.  
  113. @UNKNOWN_DESCRIBE_RESPONSE:
  114. DONE WARN "[RTSP] Unexpected response to DESCRIBE command. (${_LINE:50})"
  115.  
  116. @BAD_SETUP_RESPONSE:
  117. DONE WARN "[RTSP] Unexpected response to SETUP command. (${_LINE:50})"
  118.  
  119. @BAD_PLAY_RESPONSE:
  120. DONE WARN "[RTSP] Unexpected response to PLAY command. (${_LINE:50})"
  121.  
  122. @BAD_PAUSE_RESPONSE:
  123. DONE WARN "[RTSP] Unexpected response to PAUSE command. (${_LINE:50})"
  124.  
  125. @BAD_TEARDOWN_RESPONSE:
  126. DONE WARN "[RTSP] Unexpected response to TEARDOWN command. (${_LINE:50})"
  127.  
  128. </script>
  129.